<%each(item in items)%>
<div class="data-item" id="<%=item.id%>">
	<% if (forloop.first && !forloop.last) {%>
	This is the first item (<%=forloop.counter%>)
	<%}%>
	<%if (forloop.last && !forloop.first) {%>
	This is the last item (<%=forloop.counter%>)
	<%}%>
	<%if (forloop.first && forloop.last) {%>
	This is the one and only item
	<%}%><br>
	<strong>ID:</strong> <span><%=item.id%></span><br>
	<label for="<%=item.id%>_name">Name:</label> <input autocomplete="off" type="text" value="<%=item.name%>" name="_name" id="<%=item.id%>_name"><br>
	<label for="<%=item.id%>_desc">Description:</label> <input autocomplete="off" type="text" value="<%=item.desc%>" name="_desc" id="<%=item.id%>_desc"><br>
	<label for="<%=item.id%>_type">Type:</label>
	
	<%=select_tag('_type',item.type,types,{ id : item.id+'_type' })%><br>
	
	<label for="<%=item.id%>_longdesc">Long Description:</label> <textarea name="_longdesc" id="<%=item.id%>_longdesc"><%=item.longdesc%></textarea> <br>
	
	Params:<br>
	<select multiple="multiple" readonly="readonly" size="3">
	<%each(param in item.params)%>
		<option value="<%=forloop.counter%>"><%=forloop.counter%>: <%=param.name + '('+param.type+')'%></option>
	<%eachEnd%>	
	</select>
	<hr>
	<input type="button" value="Save" id="<%=item.id%>_save" name="item-save">
	<input type="button" value="Delete" id="<%=item.id%>_delete" name="item-delete">
</div>
<%eachEnd%>